import Vue from "vue";
import Vuex from "vuex";
import Product from "./Product"
import Cart from "./Cart"

//引入插件,插件其实就是函数,接收store作为参数
import testPlugin from "./plugins/test"
import persisted from "./plugins/persistedstate"
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    name:"李雷"
  },
  getters: {},
  mutations: {
    CHANGE_NAME(state){
      state.name = '韩梅梅'
    }
  },
  actions: {},
  modules: {
    Product,
    Cart
  },
  plugins: [testPlugin,persisted]
});
